// *********User端路由*************
// Containers
import Full from '@/containers/user/Full'
// Views
import Dashboard from '@/views/user/Dashboard'
// login
import Login from '@/views/user/Login'
// 个人信息
import Userinfo from '@/views/user/Userinfo'
// api
import Api from '@/views/user/api/Index'
export default[
  // 首页跳转user登录
  {
    path: '/',
    name: 'Home',
    redirect: '/user/login'
  },
  // user登录页面
  {
    path: '/user/login',
    name: 'UserLogin',
    component: Login
  },
  // user 后台
  {
    path: '/user',
    name: 'User',
    component: Full,
    redirect: '/user/dashboard',
    meta: {
      title: '首页',
      requireAuth: true
    },
    children: [
      {
        path: 'dashboard',
        name: 'UserDashboard',
        component: Dashboard,
        meta: {
          title: '仪表板',
          requireAuth: true
        }
      },
      {
        path: 'power',
        name: 'power',
        redirect: '/user/power/userinfo',
        component: {
          render (c) { return c('router-view') }
        },
        meta: {
          title: '我的功能',
          requireAuth: true
        },
        children: [
          {
            path: 'userinfo',
            name: 'Userinfo',
            component: Userinfo,
            meta: {
              title: '个人信息',
              requireAuth: true
            }
          },
          {
            path: 'api',
            name: 'api',
            component: Api,
            meta: {
              title: '接口管理',
              requireAuth: true
            }
          }
        ]
      }
    ]
  }
]
